<script id="t_interface_doc" type="text/template">
    <div class="container">
        <h5>接口名称 :</h5>
        <ul>
            <li><%=obj.name%></li>
        </ul>
        <h5>
            请求方式 :
        </h5>
        <ul>
            <li><%=obj.requestType%></li>
        </ul>
        <h5>请求参数</h5>
        <table class="custom_table">
            <thead>
            <tr>
                <th>参数名</th>
                <th>类型</th>
                <th>描述</th>
                <th>是否必须</th>
                <th>备注</th>
            </tr>
            </thead>
            <tbody>
            <% _.each(obj.requestBean.customFieldDocs, function(customFieldDoc) { %>
            <tr>
                <td><%=customFieldDoc.name%></td>
                <td><%=customFieldDoc.type%></td>
                <td><%=customFieldDoc.description%></td>
                <td><%=customFieldDoc.isRequire%></td>
                <td>-</td>
            </tr>
            <% }); %>
            </tbody>
        </table>
        <h5>请求示例 :</h5>
        <div class="container bg-light">
            <%console.log(obj.requestExample)%>
            <pre><%=JSON.stringify(JSON.parse(obj.requestExample), null, 2)%></pre>
        </div>
        <h5>响应参数 :</h5>
        <%
        var tableText = '';
        function show(data) {
        _.each(data,function(field){
        if(field.hasChild) {
        tableText += '<tr><td style="font-weight: 700">'+field.name+'</td><td>';
        } else {
        tableText += '<tr><td>'+field.name+'</td><td>';
        }
        tableText += field.type+'</td><td>'+field.description+'</td><td>'+field.level+'</td><td>'+field.parentName+'</td><td>-</td></tr>'
        if(field.hasChild) {
        show(field.child.customFieldDocs);
        }
        })
        };
        show(obj.responseBean.customFieldDocs);
        %>
        <table class="custom_table" id="responseTable">
            <thead>
            <tr>
                <th>参数名</th>
                <th>类型</th>
                <th>描述</th>
                <th>级别</th>
                <th>父节点</th>
                <th>备注</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>status</td>
                <td>Integer</td>
                <td>状态码</td>
                <td>0</td>
                <td>-</td>
                <td>参见&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-success-outline btn-sm" id="status_code">状态码</button>
                </td>
            </tr>
            <tr>
                <td>message</td>
                <td>String</td>
                <td>错误消息</td>
                <td>0</td>
                <td>-</td>
                <td>错误提示</td>
            </tr>
            <tr>
                <td style="font-weight: 700">data</td>
                <td>Object</td>
                <td>响应内容</td>
                <td>0</td>
                <td>-</td>
                <td>-</td>
            </tr>
            <%=tableText%>
            </tbody>
        </table>
        <h5>响应示例1 : </h5>
        <div class="container bg-light">
            <pre><%=JSON.stringify(JSON.parse(obj.responseExample), null, 2)%></pre>
        </div>
        <div class="container">
            <h1>&nbsp;</h1>
            <h1>&nbsp;</h1>
            <h1>&nbsp;</h1>
        </div>
    </div>
</script>